package com.dyna.cp.redis.handler;

import com.dyna.entity.DelayMessage;
import com.dyna.enums.RedisDelayMsgHandlerEnum;
import com.dyna.handler.RedisDelayMsgHandler;
import org.springframework.stereotype.Component;

@Component
public class TypeOneMessageHandler implements RedisDelayMsgHandler {

    @Override
    public Integer getDelayMsgType() {
        return RedisDelayMsgHandlerEnum.TEST.getValue();
    }

    @Override
    public void handle(DelayMessage message) {
        System.out.println("实现自定义消息处理器1");
        System.out.println("消息类型为:"+message.getType());
        System.out.println("消息内容为:"+message.getContent());
        System.out.println("消息过期时间为:"+message.getExpireTime());
    }

}